package com.nulldev.util.gui.customSwing;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.EmptyBorder;

import com.nulldev.util.JVM.JVM;
import com.nulldev.util.gui.swingAPI.Swing;

public class cSwingAbout extends cSwingFrame {
	private static final long serialVersionUID = -3573299882498497816L;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		Swing.enableAA();
		Swing.enableJSO();
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					cSwingAbout frame = new cSwingAbout();
					Swing.center(frame);
					frame.setVisible(true);
				} catch (Exception e) {
					JVM.errorln(e);
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public cSwingAbout() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		setTitle("cSwing: About");
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);

		JPanel panel = new JPanel();
		contentPane.add(panel, BorderLayout.CENTER);

		JLabel lblCswingUiFramework = new JLabel("cSwing UI Framework");

		JLabel lblPartOfNullutil = new JLabel("Part of nullUtil 3.0");

		JLabel lblUsesTheIcomoon = new JLabel("Uses the IcoMoon font to provide base icons");
		/*
		 * final FPSCounter fpsc = new FPSCounter(); fpsc.start(); final SmoothCanvas
		 * panel_1 = new SmoothCanvas() {
		 * 
		 * @Override public void drawCanvas(Graphics2D g2d) {
		 * g2d.setFont(FontManager.getFontSet()); fpsc.timeStart();
		 * g2d.setColor(ColorUtil.rainbow(20, 1.0f)); g2d.fillRect(0, 0, getWidth(),
		 * getHeight()); g2d.setColor(Color.BLACK);
		 * g2d.drawString("SmoothCanvas Renderer", 5, 15); g2d.drawString("FPS: " +
		 * fpsc.getFPS(), 5, 30); g2d.drawString("FPS LOCK: 60 (+- 5FPS)", 5, 45);
		 * g2d.drawString("Renderer: " + SwingUtil.getRenderer(), 5, 60);
		 * fpsc.callFPS(); fpsc.timeEnd(); } };
		 * panel_1.usePaintMethod(PaintMethod.REPAINT); panel_1.setAAEnabled(true);
		 * panel_1.setFPS(64);
		 */
		JLabel lblAFullRewrite = new JLabel("A full rewrite of the original eSwing framework.");
		GroupLayout gl_panel = new GroupLayout(panel);
		gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel.createSequentialGroup().addContainerGap().addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
						// .addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE)
						.addComponent(lblPartOfNullutil).addComponent(lblCswingUiFramework).addComponent(lblUsesTheIcomoon).addComponent(lblAFullRewrite))
						.addContainerGap()));
		gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel.createSequentialGroup().addContainerGap().addComponent(lblCswingUiFramework).addPreferredGap(ComponentPlacement.UNRELATED)
						.addComponent(lblAFullRewrite).addPreferredGap(ComponentPlacement.RELATED)
						// .addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
						.addGap(18).addComponent(lblUsesTheIcomoon).addGap(18).addComponent(lblPartOfNullutil).addContainerGap()));
		panel.setLayout(gl_panel);
	}
}
